/**
 * @Description 英雄类
 * @Author hhy
 * @Date 2020/9/21 15:58
 */
public class Hero {
    //英雄名字
    private String name;
    //经验
    private long experience;
    //攻击力
    private long power;
    //等级
    private long level;


    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public long getExperience() {
        return experience;
    }

    public void setExperience(long experience) {
        this.experience = experience;
    }

    public long getPower() {
        return power+(int)(Math.random() * 10);
    }

    public void setPower(long power) {
        this.power = power;
    }

    public long getLevel() {
        return level;
    }

    public void setLevel(long level) {
        this.level = level;
    }

    //a怪物
    public void a(Monster monster){
        monster.setHp(monster.getHp()-power);
        System.out.println(name+"攻击了"+monster.getName()+"->"+monster.getName()+"收到了"+power+"点伤害，"+monster.getName()+"还剩"+(monster.getHp()<0?0:monster.getHp())+"点血量");
    }
}
